package com.bosssoft.boss_exam_db.validator.common;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

/***
 * @Author lys(cherish)
 * @Phone 17720799636
 * @Date  2019/3/13
 * @Descriptionh 用户名校验
 **/
public class GenderValidator implements ConstraintValidator<Gender, Integer> {


    @Override
    public void initialize(Gender gender) {

    }

    @Override
    public boolean isValid(Integer value, ConstraintValidatorContext constraintValidatorContext) {
        if(!(1 ==value) && !(0 ==value)){
            return false;
        }
        return true;
    }
}
